|
|
|
|
|
|
|
To add the VB ActiveX Control Interface Wizard, click the box next to the name of the wizard. This action places a check mark in the box, indicating that the wizard will be included in the Add-Ins menu. Next, click OK to exit the Add-In Manager and add the wizard to Visual Basic. |
|
|
|
|
|
|
|
|
Now, to demonstrate how to use the wizard, re-create the Limited Character TextBox control: |
|
|
|
|
|
|
|
|
1. Start a new ActiveX Control project, and draw a text box on the UserControl window. |
|
|
|
|
|
|
|
|
2. Set up the names and sizes the same way you did in the earlier example (refer to the section "Setting Up the Base Control"). |
|
|
|
|
|
|
|
|
3. Start the wizard by choosing the ActiveX Control Interface Wizard item from the Add-Ins menu. The wizard starts by displaying the initial screen shown in Figure 14.9. |
|
|
|
|
| |
|
|
|
|
For the wizard to work most effectively, you must add all the required components to the user control before starting the wizard. |
|
|
|
|
|
|
|
|
|
|
4. Click the Next button to start the actual work of setting up your properties. |
|
|
|
|
|
|
|
|
Figure 14.9
The ActiveX Control Interface Wizard simplifies the process
of creating properties by generating much of the code for you. |
|
|
|
|
|
|
|
|
Selecting and Creating Properties |
|
|
|
|
|
|
|
|
The next step in using the ActiveX Control Interface Wizard is to select the properties, methods, and events that you want to have available to your control. Collectively, properties, methods, and events are known as members. In the Select Interface Members dialog box, shown in Figure 14.10, the wizard contains a list of the names of just about every item that you could find in any control in Visual Basic. To select a property or method to create, highlight the name of the item in the Available Names list, and then click the right-arrow button to select the item. For the sample control, highlight the Text property on the left side, and click the right-arrow button. |
|
|
|
|
| |
|
|
|
|
You also can select an item by double-clicking it in the list. |
|
|
|
|
|
|
|